Remove ecdsa dependency, use cryptography only II#4
Merged
Conversation
onvej-sl
commented
Dec 19, 2025
e0b0f49 to
ecd81f3
Compare
a9c7320 to
16c914e
Compare
Comment on lines
+918
to
+934
| def test_secp256r1_derivation_retry(): | ||
| # Test retry in public key to public key derivation | ||
| # https://github.com/satoshilabs/slips/blob/master/slip-0010.md#test-derivation-retry-for-nist256p1 | ||
| chaincode, pubkey = SLIP10.from_seed( | ||
| bytes.fromhex(SEED_1), curve_name="secp256r1" | ||
| ).get_extended_pubkey_from_path("m/28578'") | ||
| chaincode, pubkey = SLIP10( | ||
| chaincode, pubkey=pubkey, curve_name="secp256r1" | ||
| ).get_extended_pubkey_from_path("m/33941") | ||
| assert ( | ||
| chaincode.hex() | ||
| == "9e87fe95031f14736774cd82f25fd885065cb7c358c1edf813c72af535e83071" | ||
| ) | ||
| assert ( | ||
| pubkey.hex() | ||
| == "0235bfee614c0d5b2cae260000bb1d0d84b270099ad790022c1ae0b2e782efe120" | ||
| ) |
Collaborator
There was a problem hiding this comment.
This works, although ideally we should have a test that takes the path in each test vector, converts it to a list _deriv_path_str_to_list(path) and counts how many indices at the end are non-hardened. Then it should derive the node up to the last hardened index using get_child_from_path() and from there derive using only public keys. Basically the above test but automated. (Doesn't need to be done in this PR.)
andrewkozlik
approved these changes
Jan 29, 2026
b649486 to
0b8fb05
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This replaces #2. Unlike that, I've tried to use the cryptography package as much as possible.